package cytj.setup.base;

import android.app.Application;

/**
 * 存放伴随整个程序的全局单例类或变量的类
 * Created by LTP on 2015/12/14
 */
public class MyAPP extends Application {
    private static MyAPP myAPPInstance;
    private boolean isBluetoothConnected;

    @Override
    public void onCreate() {
        super.onCreate();
        myAPPInstance = this;
    }

    /**
     * 获取整个程序的单例对象
     *
     * @return 整个程序的单例对象
     */
    public static MyAPP getMyAPPInstance() {
        return myAPPInstance;
    }

    /**
     * 获取蓝牙连接的状态
     *
     * @return true 蓝牙连接状态 false 蓝牙断开状态
     */
    public boolean isBluetoothConnected() {
        return isBluetoothConnected;
    }

    /**
     * 设置蓝牙连接的状态
     *
     * @param isBluetoothConnected 蓝牙是否处于连接状态
     */
    public void setIsBluetoothConnected(boolean isBluetoothConnected) {
        this.isBluetoothConnected = isBluetoothConnected;
    }

}
